﻿package mortal.game.view.common.tooltip.tooltips.base
{
    import com.mui.controls.*;
    import com.mui.display.*;
    import flash.display.*;
    import mortal.game.view.common.*;

    public class ToolTipScaleBg extends BaseToolTip
    {
        protected var _bgName:String;
        protected var _scaleBg:ScaleBitmap;

        public function ToolTipScaleBg()
        {
            super.addChild(contentContainer2D);
            return;
        }// end function

        public function setBg(param1:String = "ToolTipBg") : void
        {
            if (this._bgName == param1)
            {
                return;
            }
            this._bgName = param1;
            if (this._scaleBg != null)
            {
                this._scaleBg.dispose(true);
                this._scaleBg = null;
            }
            this._scaleBg = UIFactory.bg(0, 0, 120, 60, null, this._bgName);
            super.addChildAt(this._scaleBg, 0);
            return;
        }// end function

        override protected function updateSize(param1:Number, param2:Number) : void
        {
            super.updateSize(param1, param2);
            if (this._scaleBg != null)
            {
                this._scaleBg.setSize(_width, _height);
            }
            return;
        }// end function

        protected function $addChild(param1:DisplayObject) : DisplayObject
        {
            return super.addChild(param1);
        }// end function

        override public function addChild(param1:DisplayObject) : DisplayObject
        {
            if (contentContainer2D != param1)
            {
                this.contentContainer2D.addChild(param1);
            }
            else
            {
                super.addChild(param1);
            }
            return param1;
        }// end function

    }
}
